# Adogs
# 时间: 2021/7/30 13:43
from scene.image_WIN_or_LOSE import WinOrLose
from scene import BaseScene, ScenePassStatus


class FailScene(BaseScene):
    """
    任务失败场景
    方法:
    1.__init__(xiao_tie)
    2.draw_actor()
    3.run(down_flag,key_list)
    """
    def __init__(self, xiao_tie):
        """
        初始化函数
        :param xiao_tie: 人物
        """
        super(FailScene, self).__init__(xiao_tie, "resources/picture/lose_game/fail.jpg")
        self.actor = WinOrLose(50, 300, "fail")

    def draw_actor(self):
        """
        绘制人物
        :return: 无返回值
        """
        self.actor.draw(self.current_surface, 0, 0)

    def run(self, down_flag, key_list):
        """
        人物运动
        :param down_flag: 判断是否点击按键
        :param key_list: 判断是否有键按下
        :return: 无返回值
        """
        self.actor.run()
        if self.actor.pos_x > 1000:
            self.pass_status = ScenePassStatus.over
